Implicit Parallelism in a Functional Subset of Scala

نویسندگان

  • Shams Imam
  • Robert Cartwright
  • Vivek Sarkar
چکیده

In this paper, we describe our approach to implicitly parallelizing programs written in a functional subset of Scala characterized by the single assignment rule. Our functional programming model is supported by a functional subset of Scala based on our past experiences with the Sisal language and the functional language level of DrJava. We automatically parallelize functional Scala programs by inserting futures and accumulators. We avoid the resource limitations that arise when tasks block on futures by executing delimited continuations on a cooperative scheduler with a fixed number of worker threads. The functional structure of programs written in our Scala subset ensures deadlock freedom since such programs cannot generate cyclic dependences among expressions/futures. Our functional programming model exposes abundant opportunities for safe implicit fine-grain parallelism at the expression level. Such expressions can be represented as future constructs that compute the value of the expression in parallel with the rest of the computation. On the other hand, introducing parallelism adds overhead to manage and schedule execution of the futures and to avoid blocking worker threads when the results of the future are required due to data dependence constraints. To achieve high performance in executing such applications on many-core processors, we must partition the computation into largely independent tasks (contrained by data dependence) with appropriate granularity that is neither too fine nor too coarse and we must must efficiently implement the representation and execution of futures. We currently rely on hand-written code and runtime techniques to determine the appropriate granularity for parallel tasks and we use delimited continuations to represent computations waiting on futures without blocking worker threads. [Copyright notice will appear here once ’preprint’ option is removed.]

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Foundations of Implicit Function Types

Implicit parameters are used pervasively in Scala and are also present in a number of other programming and theorem proving languages. Œis paper describes a generalization of implicit parameters as they are currently found in Scala to implicit function types. We motivate the construct by a series of examples and provide formal foundations that closely follow the semantics implemented by the Sca...

متن کامل

Purely Functional Structured Programming

The idea of functional programming has played a big role in shaping today’s landscape of mainstream programming languages. Another concept that dominates the current programming style is Dijkstra’s structured programming. Both concepts have been successfully married, for example in the programming language Scala. This paper proposes how the same can be achieved for structured programming and pu...

متن کامل

A High-level Language Features and Parallelism Support Comparison

This paper provides a performance and programmability comparison of high-level parallel programming support in Haskell, F# and Scala. Developing several parallel versions, we employ skeletonbased, semi-explicit and explicit approaches to parallelism. We focus on advanced language features for separating computational and coordination aspects of the code and tuning performance. We also assess th...

متن کامل

Node.Scala: Implicit Parallel Programming for High-Performance Web Services

Event-driven programming frameworks such as Node.JS have recently emerged as a promising option for Web service development. Such frameworks feature a simple programming model with implicit parallelism and asynchronous I/O. The benefits of the eventbased programming model in terms of concurrency management need to be balanced against its limitations in terms of scalability on multicore architec...

متن کامل

Functional Programming - Crossing The Chasm?

Once again the computing community is coming to appreciate the expressive power of functional programming (FP) [1, 2]. Technical gatherings are buzzing with talk and, of course, debates about Haskell, Lisp/Scheme, Erlang and their younger hybrid cousins O’Caml, Scala, F# and Clojure. At the same time, popular OO languages Java and C# are being extended to support functional constructs with even...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014